window.onload = function () {
    let list = document.getElementById('list');
    // 创建刻度盘
    for (let i = 0; i < 60; i++) {
        let li = document.createElement("li");
        li.style.transform = 'rotate(' + i * 6 + 'deg)';
        list.appendChild(li);
    }

    // 获取当前时间
    let hourDom = document.getElementById("hour");
    let minDom = document.getElementById("min");
    let secDom = document.getElementById("sec");

    // 修改表针旋转角度
    function updatePos() {
        let date = new Date();
        let hour = date.getHours();
        let min = date.getMinutes();
        let sec = date.getSeconds();
        min = min + sec / 60;
        hour = hour + min / 60;
        hourDom.style.transform = 'rotate(' + hour * 30 + 'deg)';
        minDom.style.transform = 'rotate(' + min * 6 + 'deg)';
        secDom.style.transform = 'rotate(' + sec * 6 + 'deg)';
    }

    // 初始化指针位置
    updatePos();

    // 设置定时器，指针位置更新周期为1s
    setInterval(updatePos, 1000);
}